import request from '@/utils/request'
import apiArr from '@/kaowu_api'

export function unitList(params) {
  return request({
    url: apiArr.unitList,
    method: 'get',
    params
  })
}
export function unitAdd(data) {
  return request({
    url: apiArr.unitAdd,
    method: 'post',
    data
  })
}
export function unitEdit(params, method = 'post') {
  if (method == 'post') {
    return request({
      url: apiArr.unitEdit,
      method,
      data: params
    })
  } else {
    return request({
      url: apiArr.unitEdit,
      method,
      params
    })
  }
}
export function unitDelete(data) {
  return request({
    url: apiArr.unitDelete,
    method: 'post',
    data
  })
}
export function unitModifyState(data) {
  return request({
    url: apiArr.unitModifyState,
    method: 'post',
    data
  })
}
